<html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Hammerspoon docs: BrewInfo</title>
    <style type="text/css">
      a { text-decoration: none; }
      a:hover { text-decoration: underline; }
      th { background-color: #DDDDDD; vertical-align: top; padding: 3px; }
      td { width: 100%; background-color: #EEEEEE; vertical-align: top; padding: 3px; }
      table { width: 100% ; border: 1px solid #0; text-align: left; }
      section > table table td { width: 0; }
    </style>
    <link rel="stylesheet" href="docs.css" type="text/css" media="screen" />
  </head>
  <body>
    <header>
      <h1><a href="./index.html">docs</a> &raquo; BrewInfo</h1>
      <p>Display pop-up with Homebrew Formula info, or open their URL</p>
<p>Download: <a href="https://github.com/Hammerspoon/Spoons/raw/master/Spoons/BrewInfo.spoon.zip">https://github.com/Hammerspoon/Spoons/raw/master/Spoons/BrewInfo.spoon.zip</a></p>
<p>You can bind keys to automatically display the output of <code>brew info</code> of the currently-selected package name, or to open its
homepage. I use it to quickly explore new packages from the output
of <code>brew update</code>.</p>

      </header>
      <h3>API Overview</h3>
      <ul>
        <li>Variables - Configurable values</li>
          <ul>
            <li><a href="#brew_info_delay_sec">brew_info_delay_sec</a></li>
            <li><a href="#brew_info_style">brew_info_style</a></li>
            <li><a href="#select_text_if_needed">select_text_if_needed</a></li>
            <li><a href="#select_text_modifiers">select_text_modifiers</a></li>
          </ul>
        <li>Methods - API calls which can only be made on an object returned by a constructor</li>
          <ul>
            <li><a href="#bindHotkeys">bindHotkeys</a></li>
            <li><a href="#openBrewURL">openBrewURL</a></li>
            <li><a href="#openBrewURLCurSel">openBrewURLCurSel</a></li>
            <li><a href="#showBrewInfo">showBrewInfo</a></li>
            <li><a href="#showBrewInfoCurSel">showBrewInfoCurSel</a></li>
          </ul>
      </ul>
      <h3>API Documentation</h3>
        <h4 class="documentation-section">Variables</h4>
          <section id="brew_info_delay_sec">
            <a name="//apple_ref/cpp/Variable/brew_info_delay_sec" class="dashAnchor"></a>
            <h5><a href="#brew_info_delay_sec">brew_info_delay_sec</a></h5>
            <table>
              <tr>
                <th>Signature</th>
                <td><code>BrewInfo.brew_info_delay_sec</code></td>
              </tr>
              <tr>
                <th>Type</th>
                <td>Variable</td>
              </tr>
              <tr>
                <th>Description</th>
                <td><p>An integer specifying how long the alerts generated by BrewInfo will stay onscreen</p>
</td>
              </tr>
              <tr>
                <th>Source</th>
                <td><a href="https://github.com/Hammerspoon/Spoons/blob/master/Source/BrewInfo.spoon/init.lua#L25">Source/BrewInfo.spoon/init.lua line 25</a></td>
              </tr>
            </table>
          </section>
          <section id="brew_info_style">
            <a name="//apple_ref/cpp/Variable/brew_info_style" class="dashAnchor"></a>
            <h5><a href="#brew_info_style">brew_info_style</a></h5>
            <table>
              <tr>
                <th>Signature</th>
                <td><code>BrewInfo.brew_info_style</code></td>
              </tr>
              <tr>
                <th>Type</th>
                <td>Variable</td>
              </tr>
              <tr>
                <th>Description</th>
                <td><p>A table in conformance with the <a href="http://www.hammerspoon.org/docs/hs.alert.html#defaultStyle%5B%5D">hs.alert.defaultStyle</a> format that specifies the style used by the alerts. Default value: <code>{ textFont = &quot;Courier New&quot;, textSize = 14, radius = 10 }</code></p>
</td>
              </tr>
              <tr>
                <th>Source</th>
                <td><a href="https://github.com/Hammerspoon/Spoons/blob/master/Source/BrewInfo.spoon/init.lua#L30">Source/BrewInfo.spoon/init.lua line 30</a></td>
              </tr>
            </table>
          </section>
          <section id="select_text_if_needed">
            <a name="//apple_ref/cpp/Variable/select_text_if_needed" class="dashAnchor"></a>
            <h5><a href="#select_text_if_needed">select_text_if_needed</a></h5>
            <table>
              <tr>
                <th>Signature</th>
                <td><code>BrewInfo.select_text_if_needed</code></td>
              </tr>
              <tr>
                <th>Type</th>
                <td>Variable</td>
              </tr>
              <tr>
                <th>Description</th>
                <td><p>If <code>true</code>, and no text is currently selected in the terminal, issue a double-click to select the text below the cursor, and use that as the input to <code>brew info</code>. See also <code>BrewInfo.select_text_modifiers</code>. Defaults to <code>true</code>.</p>
</td>
              </tr>
              <tr>
                <th>Source</th>
                <td><a href="https://github.com/Hammerspoon/Spoons/blob/master/Source/BrewInfo.spoon/init.lua#L39">Source/BrewInfo.spoon/init.lua line 39</a></td>
              </tr>
            </table>
          </section>
          <section id="select_text_modifiers">
            <a name="//apple_ref/cpp/Variable/select_text_modifiers" class="dashAnchor"></a>
            <h5><a href="#select_text_modifiers">select_text_modifiers</a></h5>
            <table>
              <tr>
                <th>Signature</th>
                <td><code>BrewInfo.select_text_modifiers</code></td>
              </tr>
              <tr>
                <th>Type</th>
                <td>Variable</td>
              </tr>
              <tr>
                <th>Description</th>
                <td><p>Table containing the modifiers to be used together with a double-click when <code>BrewInfo.select_text_if_needed</code> is true. Defaults to <code>{cmd = true, shift = true}</code> to issue a Cmd-Shift-double-click, which will select a continuous non-space string in Terminal and iTerm2.</p>
</td>
              </tr>
              <tr>
                <th>Source</th>
                <td><a href="https://github.com/Hammerspoon/Spoons/blob/master/Source/BrewInfo.spoon/init.lua#L44">Source/BrewInfo.spoon/init.lua line 44</a></td>
              </tr>
            </table>
          </section>
        <h4 class="documentation-section">Methods</h4>
          <section id="bindHotkeys">
            <a name="//apple_ref/cpp/Method/bindHotkeys" class="dashAnchor"></a>
            <h5><a href="#bindHotkeys">bindHotkeys</a></h5>
            <table>
              <tr>
                <th>Signature</th>
                <td><code>BrewInfo:bindHotkeys(mapping)</code></td>
              </tr>
              <tr>
                <th>Type</th>
                <td>Method</td>
              </tr>
              <tr>
                <th>Description</th>
                <td><p>Binds hotkeys for BrewInfo</p>
</td>
              </tr>
              <tr>
                  <th>Parameters</th>
                  <td><ul>
<li>mapping - A table containing hotkey modifier/key details for the following items:<ul>
<li>show_brew_info - Show output of <code>brew info</code> using the selected text as package name</li>
<li>open_brew_url - Open the homepage of the formula whose name is currently selected</li>
<li>show_brew_cask_info - Show output of <code>brew cask info</code> using the selected text as package name</li>
<li>open_brew_cask_url - Open the homepage of the Cask whose name is currently selected</li>
</ul>
</li>
</ul>
</td>
              </tr>
              <tr>
                  <th>Returns</th>
                  <td></td>
              </tr>
              <tr>
                <th>Source</th>
                <td><a href="https://github.com/Hammerspoon/Spoons/blob/master/Source/BrewInfo.spoon/init.lua#L161">Source/BrewInfo.spoon/init.lua line 161</a></td>
              </tr>
            </table>
          </section>
          <section id="openBrewURL">
            <a name="//apple_ref/cpp/Method/openBrewURL" class="dashAnchor"></a>
            <h5><a href="#openBrewURL">openBrewURL</a></h5>
            <table>
              <tr>
                <th>Signature</th>
                <td><code>BrewInfo:openBrewURL(pkg, subcommand)</code></td>
              </tr>
              <tr>
                <th>Type</th>
                <td>Method</td>
              </tr>
              <tr>
                <th>Description</th>
                <td><p>Opens the homepage for package <code>pkg</code>, as obtained from the <code>homepage</code> field in <code>brew &lt;subcommand&gt; cat &lt;pkg&gt;</code></p>
</td>
              </tr>
              <tr>
                  <th>Parameters</th>
                  <td><ul>
<li>pkg - name of the package to query</li>
<li>subcommand - brew subcommand to use for the <code>cat</code> command. Defaults to an empty string, which results in &quot;brew cat &lt;pkg&gt;&quot; being run. For example, if <code>subcommand</code> is &quot;cask&quot;, the <code>brew cask cat &lt;pkg&gt;</code> command will be used.</li>
</ul>
</td>
              </tr>
              <tr>
                  <th>Returns</th>
                  <td><ul>
<li>The Spoon object</li>
</ul>
</td>
              </tr>
              <tr>
                <th>Source</th>
                <td><a href="https://github.com/Hammerspoon/Spoons/blob/master/Source/BrewInfo.spoon/init.lua#L121">Source/BrewInfo.spoon/init.lua line 121</a></td>
              </tr>
            </table>
          </section>
          <section id="openBrewURLCurSel">
            <a name="//apple_ref/cpp/Method/openBrewURLCurSel" class="dashAnchor"></a>
            <h5><a href="#openBrewURLCurSel">openBrewURLCurSel</a></h5>
            <table>
              <tr>
                <th>Signature</th>
                <td><code>BrewInfo:openBrewURLCurSel(subcommand)</code></td>
              </tr>
              <tr>
                <th>Type</th>
                <td>Method</td>
              </tr>
              <tr>
                <th>Description</th>
                <td><p>Opens the homepage for the currently-selected package, as obtained from the <code>homepage</code> field in <code>brew &lt;subcommand&gt; cat &lt;pkg&gt;</code></p>
</td>
              </tr>
              <tr>
                  <th>Parameters</th>
                  <td><ul>
<li>subcommand - brew subcommand to use for the <code>cat</code> command. Defaults to an empty string, which results in &quot;brew cat &lt;pkg&gt;&quot; being run. For example, if <code>subcommand</code> is &quot;cask&quot;, the <code>brew cask cat &lt;pkg&gt;</code> command will be used.</li>
</ul>
</td>
              </tr>
              <tr>
                  <th>Returns</th>
                  <td><ul>
<li>The Spoon object</li>
</ul>
</td>
              </tr>
              <tr>
                <th>Source</th>
                <td><a href="https://github.com/Hammerspoon/Spoons/blob/master/Source/BrewInfo.spoon/init.lua#L148">Source/BrewInfo.spoon/init.lua line 148</a></td>
              </tr>
            </table>
          </section>
          <section id="showBrewInfo">
            <a name="//apple_ref/cpp/Method/showBrewInfo" class="dashAnchor"></a>
            <h5><a href="#showBrewInfo">showBrewInfo</a></h5>
            <table>
              <tr>
                <th>Signature</th>
                <td><code>BrewInfo:showBrewInfo(pkg, subcommand)</code></td>
              </tr>
              <tr>
                <th>Type</th>
                <td>Method</td>
              </tr>
              <tr>
                <th>Description</th>
                <td><p>Displays an alert with the output of <code>brew &lt;subcommand&gt; info &lt;pkg&gt;</code></p>
</td>
              </tr>
              <tr>
                  <th>Parameters</th>
                  <td><ul>
<li>pkg - name of the package to query</li>
<li>subcommand - brew subcommand to use for the <code>info</code> command. Defaults to an empty string, which results in &quot;brew info &lt;pkg&gt;&quot; being run. For example, if <code>subcommand</code> is &quot;cask&quot;, the <code>brew cask info &lt;pkg&gt;</code> command will be used.</li>
</ul>
</td>
              </tr>
              <tr>
                  <th>Returns</th>
                  <td><ul>
<li>The Spoon object</li>
</ul>
</td>
              </tr>
              <tr>
                <th>Source</th>
                <td><a href="https://github.com/Hammerspoon/Spoons/blob/master/Source/BrewInfo.spoon/init.lua#L84">Source/BrewInfo.spoon/init.lua line 84</a></td>
              </tr>
            </table>
          </section>
          <section id="showBrewInfoCurSel">
            <a name="//apple_ref/cpp/Method/showBrewInfoCurSel" class="dashAnchor"></a>
            <h5><a href="#showBrewInfoCurSel">showBrewInfoCurSel</a></h5>
            <table>
              <tr>
                <th>Signature</th>
                <td><code>BrewInfo:showBrewInfoCurSel(subcommand)</code></td>
              </tr>
              <tr>
                <th>Type</th>
                <td>Method</td>
              </tr>
              <tr>
                <th>Description</th>
                <td><p>Display <code>brew &lt;subcommand&gt; info</code> using the selected text as the package name</p>
</td>
              </tr>
              <tr>
                  <th>Parameters</th>
                  <td><ul>
<li>subcommand - brew subcommand to use for the <code>info</code> command. Defaults to an empty string, which results in &quot;brew info&quot; being run. For example, if <code>subcommand</code> is &quot;cask&quot;, the <code>brew cask info</code> command will be used.</li>
</ul>
</td>
              </tr>
              <tr>
                  <th>Returns</th>
                  <td><ul>
<li>The Spoon object</li>
</ul>
</td>
              </tr>
              <tr>
                <th>Source</th>
                <td><a href="https://github.com/Hammerspoon/Spoons/blob/master/Source/BrewInfo.spoon/init.lua#L108">Source/BrewInfo.spoon/init.lua line 108</a></td>
              </tr>
            </table>
          </section>
  </body>
</html>